{% extends "base.html" %}
{% load i18n json_ld %}

{% block meta_tags %}
    <meta property="og:type" content="website" />
    <meta property="og:url" content="{{ WEBSITE_URL }}{{ request.path }}" />
    <meta property="og:title" content="{{ idea.translated_title }}" />
    {% if idea.picture_social %}
        <meta property="og:image" content="{{ idea.picture_social.url }}" />
        <!-- Next tags are optional but recommended -->
        <meta property="og:image:width" content="{{ idea.picture_social.width }}" />
        <meta property="og:image:height" content="{{ idea.picture_social.height }}" />
    {% endif %}
    <meta property="og:description" content="{{ idea.translated_content }}" />
    <meta property="og:site_name" content="MyProject" />
    <meta property="og:locale" content="{{ LANGUAGE_CODE }}" />

    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:site" content="@DjangoTricks">
    <meta name="twitter:creator" content="@archatas">
    <meta name="twitter:url" content="{{ WEBSITE_URL }}{{ request.path }}">
    <meta name="twitter:title" content="{{ idea.translated_title }}">
    <meta name="twitter:description" content="{{ idea.translated_content }}">
    {% if idea.picture_social %}
        <meta name="twitter:image" content="{{ idea.picture_social.url }}">
    {% endif %}

    {% render_json_ld idea.structured_data %}
{% endblock %}


{% block content %}
    <a href="{% url "ideas1:idea_list" %}">{% trans "List of ideas" %}</a>
    <h1>
        {% blocktrans trimmed with title=idea.translated_title %}
            Idea "{{ title }}"
        {% endblocktrans %}
    </h1>
    <img src="{{ idea.picture_large.url }}" alt="" />
    {{ idea.translated_content|linebreaks|urlize }}
    <p>
        {% for category in idea.categories.all %}
            <span class="badge badge-pill badge-info">{{ category.translated_title }}</span>
        {% endfor %}
    </p>
    <a href="{% url 'ideas1:idea_handout' pk=idea.pk %}" class="btn btn-primary">{% trans "Download handout" %}</a>
    <a href="{% url 'ideas1:change_idea' pk=idea.pk %}" class="btn btn-primary">{% trans "Change this idea" %}</a>
    <a href="{% url 'ideas1:delete_idea' pk=idea.pk %}" class="btn btn-danger">{% trans "Delete this idea" %}</a>
{% endblock %}
